home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / QDOffscreen.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  6.8 KB  |  253 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QDOffscreen.h
  3.  
  4.      Contains:    Quickdraw Offscreen GWorld Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QDOFFSCREEN__
  18. #define __QDOFFSCREEN__
  19.  
  20. #ifndef __ERRORS__
  21. #include <Errors.h>
  22. #endif
  23. #ifndef __QUICKDRAW__
  24. #include <Quickdraw.h>
  25. #endif
  26.  
  27.  
  28.  
  29. #if PRAGMA_ONCE
  30. #pragma once
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40.  
  41. #if PRAGMA_STRUCT_ALIGN
  42.     #pragma options align=mac68k
  43. #elif PRAGMA_STRUCT_PACKPUSH
  44.     #pragma pack(push, 2)
  45. #elif PRAGMA_STRUCT_PACK
  46.     #pragma pack(2)
  47. #endif
  48.  
  49.  
  50. enum {
  51.     pixPurgeBit                    = 0,
  52.     noNewDeviceBit                = 1,
  53.     useTempMemBit                = 2,
  54.     keepLocalBit                = 3,
  55.     pixelsPurgeableBit            = 6,
  56.     pixelsLockedBit                = 7,
  57.     mapPixBit                    = 16,
  58.     newDepthBit                    = 17,
  59.     alignPixBit                    = 18,
  60.     newRowBytesBit                = 19,
  61.     reallocPixBit                = 20,
  62.     clipPixBit                    = 28,
  63.     stretchPixBit                = 29,
  64.     ditherPixBit                = 30,
  65.     gwFlagErrBit                = 31
  66. };
  67.  
  68.  
  69. enum {
  70.     pixPurge                    = 1L << pixPurgeBit,
  71.     noNewDevice                    = 1L << noNewDeviceBit,
  72.     useTempMem                    = 1L << useTempMemBit,
  73.     keepLocal                    = 1L << keepLocalBit,
  74.     pixelsPurgeable                = 1L << pixelsPurgeableBit,
  75.     pixelsLocked                = 1L << pixelsLockedBit,
  76.     kAllocDirectDrawSurface        = 1L << 14,
  77.     mapPix                        = 1L << mapPixBit,
  78.     newDepth                    = 1L << newDepthBit,
  79.     alignPix                    = 1L << alignPixBit,
  80.     newRowBytes                    = 1L << newRowBytesBit,
  81.     reallocPix                    = 1L << reallocPixBit,
  82.     clipPix                        = 1L << clipPixBit,
  83.     stretchPix                    = 1L << stretchPixBit,
  84.     ditherPix                    = 1L << ditherPixBit,
  85.     gwFlagErr                    = 1L << gwFlagErrBit
  86. };
  87.  
  88. typedef unsigned long                     GWorldFlags;
  89. /* Type definition of a GWorldPtr */
  90. typedef CGrafPtr                         GWorldPtr;
  91. EXTERN_API( QDErr )
  92. NewGWorld                        (GWorldPtr *            offscreenGWorld,
  93.                                  short                     PixelDepth,
  94.                                  const Rect *            boundsRect,
  95.                                  CTabHandle             cTable,
  96.                                  GDHandle                 aGDevice,
  97.                                  GWorldFlags             flags)                                FOURWORDINLINE(0x203C, 0x0016, 0x0000, 0xAB1D);
  98.  
  99. #if !TARGET_OS_MAC
  100. /* Quicktime 3.0 */
  101. #if TARGET_OS_WIN32
  102. /* gdevice attribute bits*/
  103.  
  104. enum {
  105.     deviceIsIndirect            = (1L << 0),
  106.     deviceNeedsLock                = (1L << 1),
  107.     deviceIsStatic                = (1L << 2),
  108.     deviceIsExternalBuffer        = (1L << 3),
  109.     deviceIsDDSurface            = (1L << 4),
  110.     deviceIsDCISurface            = (1L << 5),
  111.     deviceIsGDISurface            = (1L << 6),
  112.     deviceIsAScreen                = (1L << 7),
  113.     deviceIsOverlaySurface        = (1L << 8)
  114. };
  115.  
  116. EXTERN_API( void *)
  117. GetGDeviceSurface                (GDHandle                 gdh);
  118.  
  119. EXTERN_API( unsigned long )
  120. GetGDeviceAttributes            (GDHandle                 gdh);
  121.  
  122. /* to allocate non-mac-rgb GWorlds use QTNewGWorld (ImageCompression.h) */
  123. EXTERN_API( QDErr )
  124. NewGWorldFromHBITMAP            (GWorldPtr *            offscreenGWorld,
  125.                                  CTabHandle             cTable,
  126.                                  GDHandle                 aGDevice,
  127.                                  GWorldFlags             flags,
  128.                                  void *                    newHBITMAP,
  129.                                  void *                    newHDC);
  130.  
  131. #endif  /* TARGET_OS_WIN32 */
  132.  
  133. EXTERN_API( QDErr )
  134. NewGWorldFromPtr                (GWorldPtr *            offscreenGWorld,
  135.                                  unsigned long             PixelFormat,
  136.                                  const Rect *            boundsRect,
  137.                                  CTabHandle             cTable,
  138.                                  GDHandle                 aGDevice,
  139.                                  GWorldFlags             flags,
  140.                                  Ptr                     newBuffer,
  141.                                  long                     rowBytes);
  142.  
  143. #endif  /* !TARGET_OS_MAC */
  144.  
  145. EXTERN_API( Boolean )
  146. LockPixels                        (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xAB1D);
  147.  
  148. EXTERN_API( void )
  149. UnlockPixels                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0002, 0xAB1D);
  150.  
  151. EXTERN_API( GWorldFlags )
  152. UpdateGWorld                    (GWorldPtr *            offscreenGWorld,
  153.                                  short                     pixelDepth,
  154.                                  const Rect *            boundsRect,
  155.                                  CTabHandle             cTable,
  156.                                  GDHandle                 aGDevice,
  157.                                  GWorldFlags             flags)                                FOURWORDINLINE(0x203C, 0x0016, 0x0003, 0xAB1D);
  158.  
  159. EXTERN_API( void )
  160. DisposeGWorld                    (GWorldPtr                 offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0004, 0xAB1D);
  161.  
  162. EXTERN_API( void )
  163. GetGWorld                        (CGrafPtr *                port,
  164.                                  GDHandle *                gdh)                                FOURWORDINLINE(0x203C, 0x0008, 0x0005, 0xAB1D);
  165.  
  166. EXTERN_API( void )
  167. SetGWorld                        (CGrafPtr                 port,
  168.                                  GDHandle                 gdh)                                FOURWORDINLINE(0x203C, 0x0008, 0x0006, 0xAB1D);
  169.  
  170. EXTERN_API( void )
  171. CTabChanged                        (CTabHandle             ctab)                                FOURWORDINLINE(0x203C, 0x0004, 0x0007, 0xAB1D);
  172.  
  173. EXTERN_API( void )
  174. PixPatChanged                    (PixPatHandle             ppat)                                FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xAB1D);
  175.  
  176. EXTERN_API( void )
  177. PortChanged                        (GrafPtr                 port)                                FOURWORDINLINE(0x203C, 0x0004, 0x0009, 0xAB1D);
  178.  
  179. EXTERN_API( void )
  180. GDeviceChanged                    (GDHandle                 gdh)                                FOURWORDINLINE(0x203C, 0x0004, 0x000A, 0xAB1D);
  181.  
  182. EXTERN_API( void )
  183. AllowPurgePixels                (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xAB1D);
  184.  
  185. EXTERN_API( void )
  186. NoPurgePixels                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000C, 0xAB1D);
  187.  
  188. EXTERN_API( GWorldFlags )
  189. GetPixelsState                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000D, 0xAB1D);
  190.  
  191. EXTERN_API( void )
  192. SetPixelsState                    (PixMapHandle             pm,
  193.                                  GWorldFlags             state)                                FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xAB1D);
  194.  
  195. EXTERN_API( Ptr )
  196. GetPixBaseAddr                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xAB1D);
  197.  
  198. EXTERN_API( long )
  199. GetPixRowBytes                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xAB1D);
  200.  
  201. EXTERN_API( QDErr )
  202. NewScreenBuffer                    (const Rect *            globalRect,
  203.                                  Boolean                 purgeable,
  204.                                  GDHandle *                gdh,
  205.                                  PixMapHandle *            offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x000E, 0x0010, 0xAB1D);
  206.  
  207. EXTERN_API( void )
  208. DisposeScreenBuffer                (PixMapHandle             offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x0004, 0x0011, 0xAB1D);
  209.  
  210. EXTERN_API( GDHandle )
  211. GetGWorldDevice                    (GWorldPtr                 offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0012, 0xAB1D);
  212.  
  213. EXTERN_API( Boolean )
  214. QDDone                            (GrafPtr                 port)                                FOURWORDINLINE(0x203C, 0x0004, 0x0013, 0xAB1D);
  215.  
  216. EXTERN_API( long )
  217. OffscreenVersion                (void)                                                        TWOWORDINLINE(0x7014, 0xAB1D);
  218.  
  219. EXTERN_API( QDErr )
  220. NewTempScreenBuffer                (const Rect *            globalRect,
  221.                                  Boolean                 purgeable,
  222.                                  GDHandle *                gdh,
  223.                                  PixMapHandle *            offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x000E, 0x0015, 0xAB1D);
  224.  
  225. EXTERN_API( Boolean )
  226. PixMap32Bit                        (PixMapHandle             pmHandle)                            FOURWORDINLINE(0x203C, 0x0004, 0x0016, 0xAB1D);
  227.  
  228. EXTERN_API( PixMapHandle )
  229. GetGWorldPixMap                    (GWorldPtr                 offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0017, 0xAB1D);
  230.  
  231.  
  232.  
  233. #if PRAGMA_STRUCT_ALIGN
  234.     #pragma options align=reset
  235. #elif PRAGMA_STRUCT_PACKPUSH
  236.     #pragma pack(pop)
  237. #elif PRAGMA_STRUCT_PACK
  238.     #pragma pack()
  239. #endif
  240.  
  241. #ifdef PRAGMA_IMPORT_OFF
  242. #pragma import off
  243. #elif PRAGMA_IMPORT
  244. #pragma import reset
  245. #endif
  246.  
  247. #ifdef __cplusplus
  248. }
  249. #endif
  250.  
  251. #endif /* __QDOFFSCREEN__ */
  252.  
  253.